Skip to content

src: support multiple versions in node.config.json#63033

Closed
marco-ippolito wants to merge 2 commits intonodejs:mainfrom
marco-ippolito:more-work-config-file
Closed

src: support multiple versions in node.config.json#63033
marco-ippolito wants to merge 2 commits intonodejs:mainfrom
marco-ippolito:more-work-config-file

Conversation

@marco-ippolito
Copy link
Copy Markdown
Member

This PR updates the config file support with runtime version checks and multi-configurations based on version.

A config file can now declare nodeVersion to ensure it only applies to the matching Node.js major version. It can also use a top-level configs array to store multiple version-specific configs in the same file. Node.js selects the first entry whose nodeVersion matches the current runtime.
The version matches the major version, I dont think we need to be verify minor and patch

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/config

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 29, 2026
@marco-ippolito marco-ippolito force-pushed the more-work-config-file branch from a40a7dc to 5651e9d Compare April 29, 2026 10:18
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
@marco-ippolito marco-ippolito force-pushed the more-work-config-file branch from 5651e9d to f2d182c Compare April 29, 2026 10:24
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 62.56410% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.64%. Comparing base (8173251) to head (f2d182c).
⚠️ Report is 69 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/options.js 0.00% 55 Missing ⚠️
src/node_config_file.cc 87.14% 11 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63033      +/-   ##
==========================================
- Coverage   91.49%   89.64%   -1.86%     
==========================================
  Files         358      708     +350     
  Lines      151574   220543   +68969     
  Branches    23921    42295   +18374     
==========================================
+ Hits       138679   197697   +59018     
- Misses      12619    14686    +2067     
- Partials      276     8160    +7884     
Files with missing lines Coverage Δ
src/node_config_file.h 100.00% <ø> (ø)
src/node_config_file.cc 84.14% <87.14%> (ø)
lib/internal/options.js 35.84% <0.00%> (-10.76%) ⬇️

... and 470 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marco-ippolito marco-ippolito added the review wanted PRs that need reviews. label May 4, 2026
Comment thread test/parallel/test-config-file.js
@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label May 5, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 5, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@marco-ippolito marco-ippolito added the commit-queue Add this label to land a pull request using GitHub Actions. label May 6, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels May 6, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/63033
✔  Done loading data for nodejs/node/pull/63033
----------------------------------- PR info ------------------------------------
Title      src: support multiple versions in node.config.json (#63033)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     marco-ippolito:more-work-config-file -> nodejs:main
Labels     c++, lib / src, needs-ci, review wanted
Commits    2
 - src: support multiple versions in node.config.json
 - doc: document the latest-vX.x schema
Committers 1
 - Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Wed, 29 Apr 2026 10:16:23 GMT
   ✔  Approvals: 1
   ✔  - Pietro Marchini (@pmarchini): https://github.com/nodejs/node/pull/63033#pullrequestreview-4229807108
   ✘  This PR needs to wait 4 more hours to land (or 0 minutes if there is one more approval)
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-05-05T19:54:30Z: https://ci.nodejs.org/job/node-test-pull-request/73183/
- Querying data for job/node-test-pull-request/73183/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/25419716012

@marco-ippolito marco-ippolito added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels May 6, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels May 6, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/63033
✔  Done loading data for nodejs/node/pull/63033
----------------------------------- PR info ------------------------------------
Title      src: support multiple versions in node.config.json (#63033)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     marco-ippolito:more-work-config-file -> nodejs:main
Labels     c++, lib / src, needs-ci, review wanted
Commits    2
 - src: support multiple versions in node.config.json
 - doc: document the latest-vX.x schema
Committers 1
 - Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Wed, 29 Apr 2026 10:16:23 GMT
   ✔  Approvals: 2
   ✔  - Pietro Marchini (@pmarchini): https://github.com/nodejs/node/pull/63033#pullrequestreview-4229807108
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/63033#pullrequestreview-4237600552
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-05-06T06:19:44Z: https://ci.nodejs.org/job/node-test-pull-request/73183/
- Querying data for job/node-test-pull-request/73183/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 63033
From https://github.com/nodejs/node
 * branch                  refs/pull/63033/merge -> FETCH_HEAD
✔  Fetched commits as e80b5d2ab211..f2d182ce354d
--------------------------------------------------------------------------------
Auto-merging doc/api/cli.md
Auto-merging src/node_config_file.cc
Auto-merging test/parallel/test-config-file.js
[main a9c54e2e3d] src: support multiple versions in node.config.json
 Author: Marco Ippolito <marcoippolito54@gmail.com>
 Date: Wed Apr 29 11:59:55 2026 +0200
 6 files changed, 1610 insertions(+), 1040 deletions(-)
Auto-merging doc/api/cli.md
[main 18d4827b1e] doc: document the latest-vX.x schema
 Author: Marco Ippolito <marcoippolito54@gmail.com>
 Date: Wed Apr 29 12:18:20 2026 +0200
 1 file changed, 2 insertions(+), 1 deletion(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
(node:362) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/4)

�[KExecuting: git node land --amend --yes
--------------------------------- New Message ----------------------------------
src: support multiple versions in node.config.json

Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: #63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD a10ff2bce1] src: support multiple versions in node.config.json
Author: Marco Ippolito <marcoippolito54@gmail.com>
Date: Wed Apr 29 11:59:55 2026 +0200
6 files changed, 1610 insertions(+), 1040 deletions(-)
Rebasing (3/4)
Rebasing (4/4)

�[KExecuting: git node land --amend --yes
--------------------------------- New Message ----------------------------------
doc: document the latest-vX.x schema

Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: #63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD ec8ad76ace] doc: document the latest-vX.x schema
Author: Marco Ippolito <marcoippolito54@gmail.com>
Date: Wed Apr 29 12:18:20 2026 +0200
1 file changed, 2 insertions(+), 1 deletion(-)

�[KSuccessfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/25448865776

@marco-ippolito marco-ippolito added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels May 6, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 6, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Landed in c52fad3...1800049

nodejs-github-bot pushed a commit that referenced this pull request May 6, 2026
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: #63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request May 6, 2026
Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: #63033
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@ljharb
Copy link
Copy Markdown
Member

ljharb commented May 6, 2026

ftr you will definitely need to check the minor version, since new config options could be added in a minor.

@marco-ippolito
Copy link
Copy Markdown
Member Author

ftr you will definitely need to check the minor version, since new config options could be added in a minor.

Who's running the same config against multiple minor versions? The most common use case for package author is to run against multiple majors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. review wanted PRs that need reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants